Hands-On Internet of Things with MQTT by Tim Pulver

Hands-On Internet of Things with MQTT by Tim Pulver

Author:Tim Pulver [Tim Pulver]
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2019-10-03T16:00:00+00:00


Controlling the servo motor via the Serial Monitor

In the previous section, we verified the following:

Whether the Arduino can connect to the internet

Whether the Arduino can send and receive MQTT messages via shiftr.io

Whether the motor is working

Now, let's create an interface to control the servo from the Serial Monitor. Create a new sketch and save it as ch5_01_servo_serial.

Delete the boilerplate code that is automatically added to new sketches (the empty setup and loop functions) and replace the contents of your editor with the following code:

#include <Servo.h>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.